#include <iostream>
#include <vector>
#include <string>

using namespace std;

string s;

int main()
{
    cin >> s;
    int i = 0;
    int len = 0;
    vector<string> ans;
    while (i < s.size())
    {
        if (s[i] >= '0' && s[i] <= '9')
        {
            int j = i;
            while (j < s.size() && s[j] >= '0' && s[j] <= '9') j++;
            // cout << j << endl;
            int newlen = j - i;
            if (j == s.size() && s[j] >= '0' && s[i] <= '9') newlen++;
            if (newlen > len)
            {
                len = newlen;
                while (ans.size()) ans.pop_back();
                if(j < s.size()) ans.push_back(s.substr(i, newlen));
                else if (s[j] < '0' || s[j] > '9') ans.push_back(s.substr(i, newlen));
                else ans.push_back(s.substr(i));
                i = j - 1;
            }
            else if (newlen == len)
            {
                if (j < s.size()) ans.push_back(s.substr(i, newlen));
                else if (s[j] < '0' || s[j] > '9') ans.push_back(s.substr(i, newlen));
                else ans.push_back(s.substr(i));
                i = j - 1;
            }
        }
        i++;
    }
    for (auto x : ans) cout << x;
    cout << "," << len << endl;
    return 0;
}
